﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request["mode"] == "logout")
            {
                Helper.Logout();
            }
        }
    }
    protected void LoginButton_Click(object sender, EventArgs e)
    {
        if (this.Username.Text == "intorise" && this.Password.Text == "1qaz2wsx")
        {
            Helper.Login(this.Username.Text);
            Response.Redirect("Default.aspx");
        }
        else
        {
            Helper.Logout();
            this.Message.Visible = true;
        }
    }
}